
#ifndef _MEMBER_BTREEWIDGET_H_
#define _MEMBER_BTREEWIDGET_H_

#include <BImage>
#include <BScrollBar>
#include <BScrollArea>
#include <BTreeItem>
#include <BTreeWidget>

#define tree_member(tree)		((member_BTreeWidget*)((BTreeWidget*)tree)->_ptr)

namespace BWE
{
	class member_BTreeWidget : public BObject
	{
	public:
		member_BTreeWidget(BTreeWidget* treeWidget);
		~member_BTreeWidget();
		
		bool freshRects();
		void freshItemRect(const BFont* font, BTreeItem* item, int x, int& y, int& height, int width, int& realWidth);

		void expandAll(BTreeItem* item);
		void shrinkAll(BTreeItem* item);

		void slotCountChanged(BObject* object, const BValue& value);

		BTreeWidget*			boss;
		bool					dirty;
		int						indent;
		int						space;
		int						rowHeight;
		int						headerHeight;
		BSize					imageSize;
		int						arrowSize;

		BImageHolder			expandImage;
		BPoint					expandA;
		BPoint					expandB;
		BPoint					expandC;

		BImageHolder			shrinkImage;
		BPoint					shrinkA;
		BPoint					shrinkB;
		BPoint					shrinkC;

		bool					multiChoose;
		bool					continuChoose;
		bool					hoveredIndicator;

		BArray<BTreeItemHolder>	topItems;
		BTreeItem*				hoveredItem;
		BList<BTreeItem*>		selectedItems;
		BArray<BTreeItem*>		visualItems;
		BPoint					pressPos;
	};
}
#endif